import $http from '@/assets/js/http'

//获得藏品详情
export function getGoodsDetails(userId,id,lang) {
    return $http.get('/api/goods/detail', {
        params: { 
            userId:userId,
            goodsId:id,
            lang:lang,
        }
    });
}

//藏品提交保证金
// export function postBond (param) {
//     return $http.post('/api/goods/bond',{
    
//         goodsId:param.goodsId,
//         payType:param.payType,//支付方式:1余额，2支付宝，3微信
     
//     });
// }

//我的余额 支付
export function postBalancePay (param) {
    return $http.post('/api/pay/balance',{
        userId:param.userId,
        orderCode:param.orderCode,//支付方式:1余额，2支付宝，3微信
        lang:param.lang,
    });
}

//创建置换订单
export function postCreateExchangeOrder (param) {
    return $http.post('/api/goods/exchange/create',{
        userId:param.userId,
        addressId:param.addressId,
        goodsId:param.goodsId,//置换的商品ID（对方的）
        goodsNum:param.goodsNum,//置换的数量（对方的）
        myGoods:param.myGoods,//我的商品，格式：[{"goodsId": 1, "num": 1},{"goodsId": 2, "num": 2}]字符串类型
        lang:param.lang,
    });
}

//创建购买订单
export function postCreatepurchaseOrder (param) {
    return $http.post('/api/goods/purchase/create',{
        userId:param.userId,
        goodsId:param.goodsId,
        purchaseNum:param.purchaseNum,
        addressId:param.addressId,
        lang:param.lang,
    });
}